//
//  YTShareCell.m
//  yitaicaijing
//
//  Created by DIANGHONG on 2018/8/6.
//  Copyright © 2018年 DIANGHONG. All rights reserved.
//

#import "YTShareCell.h"
#import <HMScannerController.h>
@interface YTShareCell()
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;

@property (weak, nonatomic) IBOutlet UILabel *weekLabel;
@property (weak, nonatomic) IBOutlet UILabel *dateLabel;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UIImageView *qrImageView;

@end
@implementation YTShareCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    NSString *cardName = @"http://api.etaicj.com/InvitingFriends/loader";
    UIImage *avatar = [UIImage imageNamed:@"2221533532954_.pic_hd"];
    
    [HMScannerController cardImageWithCardName:cardName avatar:avatar scale:0.2 completion:^(UIImage *image) {
        self.qrImageView.image = image;
    }];
    
}
- (void)setModel:(YTLivesModel *)model
{
    _model = model;
    
    // 设置内容行间距 字间距
    NSMutableAttributedString *attributedString =  [[NSMutableAttributedString alloc] initWithString:model.content attributes:@{NSKernAttributeName : @(1.5f)}];
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle setLineSpacing:6];
    [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, model.content.length)];
    [self.contentLabel setAttributedText:attributedString];
    
 
    self.titleLabel.text = model.post_title;
    
    self.weekLabel.text = model.week;
    self.dateLabel.text = model.post_date;
}



@end
